<!--登记收账-->
<!DOCTYPE html SYSTEM "http://www.thymeleaf.org/dtd/xhtml1-strict-thymeleaf-spring4-4.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:th="http://www.thymeleaf.org">
<head>
    <title>首页</title>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
</head>
<body>
<div    id="content">
    <section class="content-header">
        <h1>
            <i class="fa fa-dashboard"></i>
            <strong>应收账管理</strong>
        </h1>
        <ol class="breadcrumb">
            <li><a href="#"><i class="fa fa-home "></i>Home</a></li>
            <li>应收账/回款</li>
            <li class="active">收账查询</li>
        </ol>
    </section>
    <!-- Main content -->
    <section class="content">
        <div class="row">
            <div class="col-md-12">
                <div class="box box-info">
                    <div class="widget-content nopadding">
                        <form id="paidForm">
                        <table class="table table-bordered">
                            <tbody>
                            <tr>
                                <td width="8%" align="center">合同编号</td>
                                <td width="16%">
                                    <div class="col-md-11">
                                        <input class="form-control" type="text"  readonly="readonly" name="code" th:value="${contract.supplierCode}" />
                                        <input class="form-control" type="hidden" id="contractId" name="contractId" th:value="${contract.Id}"/>
                                        <input class="form-control" type="hidden" id="contractType" name="contractId" th:value="${contract.contractType}"/>
                                        <input class="form-control" type="hidden" id="userId" name="userId" th:value="${userId}"/>
                                        <input class="form-control" type="hidden" id="sumScheduleSum" name="sumScheduleSum" th:value="${sumScheduleSum}"/>
                                        <input class="form-control" type="hidden" id="divideScales" name="divideScales" th:value="${divideScales}"/>
                                    </div>
                                </td>
                                <td width="8%" align="center">公司名称</td>
                                <td width="16%">
                                    <div class="col-md-12">
                                        <input class="form-control" type="text" readonly="readonly" name="compName" th:value="${contract.orderUnit}"/>
                                    </div>
                                </td>

                                <td width="8%" align="center">合同总额(元)</td>
                                <td width="16%">
                                    <div class="col-md-11">
                                        <input class="form-control" type="text"  readonly="readonly" name="paySum" th:value="${#numbers.formatDecimal(contract.totalSum,1,2)}"/>
                                    </div>
                                </td>
                            </tr>
                            <tr>
                                <td width="8%" align="center">负责人</td>
                                <td width="16%">
                                    <div class="col-md-11">
                                        <input class="form-control" type="text" readonly="readonly" name="receiver" th:value="${contract.dutyOfficer}"/>
                                    </div>
                                </td>
                                <td width="8%" align="center">签订时间</td>
                                <td width="16%">
                                    <div class="col-md-12">
                                        <input class="form-control" type="text"
                                               readonly="readonly" id="signedDate1"
                                               disabled="disabled"/>
                                        <input class="hide" type="text"
                                               readonly="readonly" id="signedDate"
                                               disabled="disabled"
                                               th:value="${contract.signedDate}"/>
                                    </div>
                                </td>
                                <td width="8%" align="center">交货时间</td>
                                <td width="16%">
                                    <div class="col-md-11">
                                        <input class="form-control" type="text"
                                               id="giveOutDate1" readonly="readonly"
                                               disabled="disabled"/>
                                        <input class="hide" type="text"
                                               id="giveOutDate" readonly="readonly"
                                               disabled="disabled"
                                               th:value="${contract.giveOutDate}"/>
                                    </div>
                                </td>
                            </tr>
                            <tr>
                                <td width="8%" align="center">项目名称</td>
                                <td colspan="3">
                                    <div class="col-md-12">
                                        <input class="form-control" type="text"  readonly="readonly" name="name" th:value="${contract.projectName}"/>
                                    </div>
                                </td>
                                <td width="8%" align="center">片区/行业</td>
                                <td width="16%">
                                    <div class="col-md-11">
                                        <input class="form-control" type="text" readonly="readonly" name="arae" th:value="${contract.orderArea}"/>
                                    </div>
                                </td>
                            </tr>
                            <tr>
                                <td width="8%" align="center">备注</td>
                                <td colspan="3">
                                    <div class="col-md-12">
                                        <textarea class="form-control" style="width:100%" row="2" readonly="readonly" th:value="${contract.memo}"></textarea>
                                    </div>
                                </td>
                            </tr>
                                <tr>
                                    <td width="8%" align="center">付款方式</td>
                                    <td colspan="3">
                                        <div class="col-md-12">
                                            <textarea class="form-control" style="width:100%" name="payWay" id="payWay" th:value="${contract.payType}" readonly="readonly"></textarea>
                                        </div>
                                    </td>
                                </tr>
                            </tbody>
                        </table>
                        </form>
                    </div>
                            <!-- Custom Tabs -->
                            <div class="nav-tabs-custom">
                                <ul class="nav nav-tabs" id="myTabs">
                                    <li class="payHistory" id="tab1"><a href="#tab_" data-toggle="tab">占比划分</a></li>
                                    <li><a href="#tab_1" data-toggle="tab">回款计划</a></li>
                                    <li><a href="#tab_2" class="active" data-toggle="tab">回款历史</a></li>
                                    <li><a href="#tab_3" class="showOldPayment" data-toggle="tab">开票历史</a></li>
                                    <li><a href="#tab_4" class="showPaid" data-toggle="tab">回款-计划</a></li>
                                    <li><a href="#tab_5" class="showPayment" data-toggle="tab">开票-计划</a></li>
                                </ul>
                                <div class="tab-content">
                                    <div class="tab-pane " id="tab_">
                                        <table id="resultScaleTable" class="mytable dataTable table-bordered text-center table-striped table-hover" cellspacing="0" width="100%">
                                            <thead>
                                            <tr>
												<th width="6%" >序号</th>
												<th width="15%" >负责人</th>
												<th width="15%" >所属片区</th>
												<th width="20%" >占比划分(元)</th>
												<th width="15%" >百分比</th>
												<th width="24%" >备注</th>
											</tr>
                                            </thead>
                                            <tbody>
                                            </tbody>
                                        </table>
                                    </div>
                                    <div class="tab-pane " id="tab_1">
                                        <table id="scheduleTable" class="mytable dataTable table-bordered text-center table-striped table-hover" cellspacing="0" width="100%">
                                            <thead>
                                            <tr>
                                                <th width="20%" >序号</th>
                                                <th width="20%" >款项</th>
                                                <th width="20%" >金额(元)</th>
                                                <th width="20%" >计划收款时间</th>
                                                <th width="20%" >备注</th>
                                            </tr>
                                            </thead>
                                            <tbody>
                                            </tbody>
                                        </table>
                                    </div>
                                    <div class="tab-pane active" id="tab_2">
                                        <table id="payTable" class="mytable dataTable table-bordered text-center table-striped table-hover" cellspacing="0" width="100%" type="2">
                                            <thead>
                                            <tr>
                                                <th width="10%">序号</th>
                                                <th width="20%">回款金额(元)</th>
                                                <th width="20%">回款方式</th>
                                                <th width="20%">回款时间</th>
                                                <th width="10%">回款人</th>
                                                <th width="10%">备注</th>
                                            </tr>
                                            </thead>
                                            <tbody>
                                            </tbody>
                                        </table>
                                        <table class="table table-bordered">
                                            <tbody>
                                            <tr>
                                                <td width="8%" class="center">合同总金额</td>
                                                <td width="16%">
                                                    <div class="col-md-11">
                                                        <div class="input-group">
                                                        <input class="form-control" type="text" name="paidSum1" id="paySum1" th:value="${#numbers.formatDecimal(contract.totalSum,1,2)}" readonly="readonly"/>
                                                            <span  class="input-group-addon">元</span>
                                                        </div>
                                                        </div>
                                                </td>
                                                <td width="8%" class="center">回款总金额</td>
                                                <td width="16%">
                                                    <div class="col-md-11">
                                                        <div class="input-group">
                                                        <input class="form-control" type="text" name="paySum" id="paySum" readonly="readonly" th:value="${#numbers.formatDecimal(paidSum,1,2)}"/>
                                                            <span  class="input-group-addon">元</span>
                                                        </div>
                                                        </div>
                                                </td>
                                                <td width="8%" class="center">剩余金额</td>
                                                <td width="16%">
                                                    <div class="col-md-11">
                                                        <div class="input-group">
                                                        <input class="form-control" type="text" name="paidRemain" id="paidRemain" readonly="readonly" th:value="${#numbers.formatDecimal(contract.totalSum-paidSum,1,2)}"/>
                                                            <span  class="input-group-addon">元</span>
                                                        </div>
                                                        </div>
                                                </td>
                                            </tr>
                                            </tbody>
                                        </table>
                                    </div>
                                    <div class="tab-pane" id="tab_3">
                                        <table id="paymentTable" class="mytable dataTable table-bordered text-center table-striped table-hover" cellspacing="0" width="100%" type="3">
                                            <thead>
                                            <tr>
                                                <th width="10%">序号</th>
                                                <th width="20%">开票金额(元)</th>
                                                <th width="20%">开票时间</th>
                                                <th width="20%">开票人</th>
                                                <th width="20%">备注</th>
                                            </tr>
                                            </thead>
                                            <tbody>
                                            </tbody>
                                        </table>
                                        <table class="table table-bordered">
                                            <tbody>
                                            <tr>
                                                <td width="8%" class="center">合同总金额</td>
                                                <td width="16%">
                                                    <div class="col-md-11">
                                                        <div class="input-group">
                                                        <input class="form-control" type="text" name="paidSum2" id="paySum2" th:value="${#numbers.formatDecimal(contract.totalSum,1,2)}" readonly="readonly"/>
                                                            <span  class="input-group-addon">元</span>
                                                        </div>
                                                        </div>
                                                </td>
                                                <td width="8%" class="center">开票总金额</td>
                                                <td width="16%">
                                                    <div class="col-md-11">
                                                        <div class="input-group">
                                                        <input class="form-control" type="text" name="payment" id="payment" readonly="readonly" th:value="${#numbers.formatDecimal(paymentSum,1,2)}"/>
                                                        <span  class="input-group-addon">元</span>
                                                        </div>
                                                        </div>
                                                </td>
                                                <td width="8%" class="center">剩余金额</td>
                                                <td width="16%">
                                                    <div class="col-md-11">
                                                        <div class="input-group">
                                                        <input class="form-control" type="text" name="remain" id="remain" readonly="readonly" th:value="${#numbers.formatDecimal(contract.totalSum-paymentSum,1,2)}" />
                                                        <span  class="input-group-addon">元</span>
                                                    </div>
                                                        </div>
                                                </td>
                                            </tr>
                                            </tbody>
                                        </table>
                                    </div>
                                    <div class="tab-pane" id="tab_4">
                                        <table id="paidScheduleTable" class="mytable dataTable table-bordered text-center table-striped table-hover" cellspacing="0" width="100%">
                                            <thead>
                                            <tr>
                                                <th width="10%" >序号</th>
                                                <th width="10%" >款项</th>
                                                <th width="15%" >回款计划金额(元)</th>
                                                <th width="15%" >回款金额进度(元)</th>
                                                <th width="20%" >计划收款时间</th>
                                                <th width="15%" >回款时间偏差(天)</th>
                                                <th width="15%" >备注</th>
                                            </tr>
                                            </thead>
                                            <tbody>
                                            </tbody>
                                        </table>
                                    </div>
                                    <div class="tab-pane" id="tab_5">
                                        <table id="paymentScheduleTable" class="mytable dataTable table-bordered text-center table-striped table-hover" cellspacing="0" width="100%">
                                            <thead>
                                            <tr>
                                                <th width="20%" >序号</th>
                                                <th width="20%" >款项</th>
                                                <th width="20%" >开票金额进度(元)</th>
                                                <th width="20%" >计划收款时间</th>
                                                <th width="20%" >备注</th>
                                            </tr>
                                            </thead>
                                            <tbody>
                                            </tbody>
                                        </table>
                                    </div>
                                </div><!-- /.tab-content -->
                            </div><!-- nav-tabs-custom -->
                    <a type="button" class="btn btn-default pull-right" href="javascript:history.go(-1)">返回</a>
                </div>
             </div>
            </div>
    </section>
    
    
    <script th:src="@{/accountsreceivable/accountsreceivable-audit-view.js}"></script>
    <script>
        $(function () {
            $('#myTabs a[href="#tab_2"]').tab('show');
            $('#myTabs a[href="#tab_2"]').click(function (e) {
                e.preventDefault();
            });
            $('#myTabs a[href="#tab_3"]').click(function (e) {
                e.preventDefault();
            });
            $('#myTabs a[href="#tab_1"]').click(function (e) {
                e.preventDefault();
            })
            $('#myTabs a[href="#tab_4"]').click(function (e) {
                e.preventDefault();
            });
            $('#myTabs a[href="#tab_5"]').click(function (e) {
                e.preventDefault();
            });
            $('#myTabs a[href="#tab_"]').click(function (e) {
                e.preventDefault();
            })
        });
        jQuery(function() {
            if (jQuery("#giveOutDate").val() != '') {
                var sendDate = jQuery("#giveOutDate").val();
                jQuery("#giveOutDate1").val(
                        moment(sendDate).format('YYYY-MM-DD'));
            }
            if (jQuery("#signedDate").val() != '') {
                var sendDate = jQuery("#signedDate").val();
                jQuery("#signedDate1").val(
                        moment(sendDate).format('YYYY-MM-DD'));
            }
        });
    </script>
</div>
</body>
</html>